<?php

require_once('rb.php');
R::setup('mysql:host=ftp.giemiebier.nl:3306;dbname=personify', 'school', 'admin123');

if (isset($_POST['user1']) && isset($_POST['user2'])) {
    $connection = R::dispense("pending");
    $connection->userid1 = $_POST['user1'];
    $connection->userid2 = $_POST['user2'];
    R::store($connection);
 
    $return['valid'] = true;
    $return['user1'] = $_POST['user1'];
    $return['user2'] = $_POST['user2'];
} else {
    $return['valid'] = false;
}
echo json_encode($return);

?>
